    package Clases;

import java.io.Serializable;
import java.util.List;
import javax.persistence.Entity;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToMany;
import javax.persistence.ManyToOne;



@Entity
public class Movie implements Serializable{

    int movie_id;
    String name;
    int año;
    String genre;
    String keywordsPlots;
    float rating;
    float duration;
    String cover;
    boolean avaibleForRental;
    boolean avaibleForPurchase;
    Director director;
    private List actor;

    public Movie() {
    }
    
    public Movie(String name,String genre){
        this.name = name;
        this.genre = genre;
}

    public boolean isAvaibleForPurchase() {
        return avaibleForPurchase;
    }

    public void setAvaibleForPurchase(boolean avaibleForPurchase) {
        this.avaibleForPurchase = avaibleForPurchase;
    }

    public boolean isAvaibleForRental() {
        return avaibleForRental;
    }

    public void setAvaibleForRental(boolean avaibleForRental) {
        this.avaibleForRental = avaibleForRental;
    }

    public int getAño() {
        return año;
    }

    public void setAño(int año) {
        this.año = año;
    }

    public String getCover() {
        return cover;
    }

    public void setCover(String cover) {
        this.cover = cover;
    }

    public float getDuration() {
        return duration;
    }

    public void setDuration(float duration) {
        this.duration = duration;
    }

    public String getGenre() {
        return genre;
    }

    public void setGenre(String genre) {
        this.genre = genre;
    }

    public String getKeywordsPlots() {
        return keywordsPlots;
    }

    public void setKeywordsPlots(String keywordsPlots) {
        this.keywordsPlots = keywordsPlots;
    }

    @Id
    public int getMovie_id() {
        return movie_id;
    }

    public void setMovie_id(int movie_id) {
        this.movie_id = movie_id;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public float getRating() {
        return rating;
    }

    public void setRating(float rating) {
        this.rating = rating;
    }

    @ManyToOne
    @JoinColumn(name = "movie_id")
    public Director getDirector() {
        return this.director;
    }
    @ManyToMany(mappedBy="movies")
    public List getActor() {
        return actor;
    }
    public void setActor(List actor) {
        this.actor = actor;
    }
    

}
